package cn.tedu.mall.front.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/front/spu")
public class FrontSpuController {
    @Autowired
    private RestTemplate  restTemplate;

    @RequestMapping("/{id}")
    public String getFrontSpuById(@PathVariable("id") Long id ){
        return restTemplate.getForObject("http://mall-product/pms/spu/"+id,String.class);
    }



}
